<template>
  <div>

    <el-card shadow="always" body-style="padding:'20px'">

      <el-tabs type="border-card">
        <el-tab-pane label="全部订单">
          <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
            <el-form-item label="订单编号" prop="orderSn">
              <el-input
                v-model="queryParams.orderSn"
                placeholder="请输入订单编号"
                clearable
                size="small"
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>

            <el-form-item label="收货人姓名" prop="shippingUser">
              <el-input
                v-model="queryParams.shippingUser"
                placeholder="请输入收货人姓名"
                clearable
                size="small"
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>

            <el-form-item>
              <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>

          <el-table v-loading="loading" :data="masterList" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '线下' : '微信'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>


          <pagination
            v-show="total>0"
            :total="total"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getList"
          />
        </el-tab-pane>
        <el-tab-pane label="待付款">



          <el-table v-loading="loading" :data="masterListYI" @selection-change="handleSelectionChangeYi">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalYI>0"
            :total="totalYI"
            :page.sync="queryParamsYI.pageNum"
            :limit.sync="queryParamsYI.pageSize"
            @pagination="getListYI"
          />

        </el-tab-pane>
        <el-tab-pane label="待发货">


          <!--<el-row :gutter="10" class="mb8">-->
            <!--<el-col :span="1.5">-->

              <!--<el-button-->
                <!--type="success"-->
                <!--icon="el-icon-edit"-->
                <!--size="mini"-->
                <!--:disabled="single"-->
                <!--@click="handleUpdate"-->
                <!--v-hasPermi="['shopping:ordermaster:updateFaHuo']"-->
              <!--&gt;确认发货</el-button>-->
            <!--</el-col>-->
          <!--</el-row>-->


          <el-table v-loading="loading" :data="masterListER" @selection-change="handleSelectionChangeER">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-edit"
                  @click="handleUpdate(scope.row)"
                  v-hasPermi="['shopping:ordermaster:edit']"
                >确认发货</el-button>
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalER>0"
            :total="totalER"
            :page.sync="queryParamsER.pageNum"
            :limit.sync="queryParamsER.pageSize"
            @pagination="getListER"
          />

        </el-tab-pane>
        <el-tab-pane label="待收货">
          <el-table v-loading="loading" :data="masterListSAN" @selection-change="handleSelectionChangeSAN">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalSAN>0"
            :total="totalSAN"
            :page.sync="queryParamsSAN.pageNum"
            :limit.sync="queryParamsSAN.pageSize"
            @pagination="getListER"
          />

        </el-tab-pane>
        <el-tab-pane label="已收货">
          <el-table v-loading="loading" :data="masterListSI" @selection-change="handleSelectionChangeSI">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalSI>0"
            :total="totalSI"
            :page.sync="queryParamsSI.pageNum"
            :limit.sync="queryParamsSI.pageSize"
            @pagination="getListER"
          />

        </el-tab-pane>
        <el-tab-pane label="交易取消">
          <el-table v-loading="loading" :data="masterListWU" @selection-change="handleSelectionChangeWU">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalWU>0"
            :total="totalWU"
            :page.sync="queryParamsWU.pageNum"
            :limit.sync="queryParamsWU.pageSize"
            @pagination="getListER"
          />

        </el-tab-pane>
        <el-tab-pane label="删除订单">
          <el-table v-loading="loading" :data="masterListLIU" @selection-change="handleSelectionChangeLIU">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="totalLIU>0"
            :total="totalLIU"
            :page.sync="queryParamsLIU.pageNum"
            :limit.sync="queryParamsLIU.pageSize"
            @pagination="getListER"
          />

        </el-tab-pane>
        <el-tab-pane label="取消订单">
          <el-table v-loading="loading" :data="masterListQI" @selection-change="handleSelectionChangeQI">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="文件id" align="center" prop="orderId" />
            <el-table-column label="订单编号" align="center" prop="orderSn" />
            <el-table-column label="收货人姓名" align="center" prop="shippingUser" />
            <el-table-column label="地址" align="center" prop="address" />
            <el-table-column label="支付方式" align="center"  >
              <template slot-scope="scope">
                {{scope.row.paymentMethod=='1' ? '支付宝' : scope.row.paymentMethod=='2' ? '微信' : '线下'}}
              </template>
            </el-table-column>
            <el-table-column label="订单金额" align="center" prop="orderMoney" />
            <el-table-column label="发货时间" align="center" prop="shippingTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.shippingTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.payTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="收货时间" align="center" prop="receiveTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.receiveTime ) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品名称" align="center" prop="productName" />
            <el-table-column label="用户名称" align="center" prop="customerName" />
            <el-table-column label="订单状态" align="center" prop="orderStatus" >
              <template slot-scope="scope">
                {{scope.row.orderStatus=='1' ? '待付款' : scope.row.orderStatus=='2' ? '待发货' : scope.row.orderStatus=='3' ? '待收货' : scope.row.orderStatus=='4' ? '已收货' : scope.row.orderStatus=='5' ? '交易取消' : scope.row.orderStatus=='6' ? '删除订单' : scope.row.orderStatus=='7' ? '取消订单' : '退货'}}
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  v-if="scope.row.paymentMethod == 3"
                  @click="handelDialogVoucher(scope.row)"
                >查看凭证</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>

        <pagination
          v-show="totalQI>0"
          :total="totalQI"
          :page.sync="queryParamsQI.pageNum"
          :limit.sync="queryParamsQI.pageSize"
          @pagination="getListER"
        />

      </el-tabs>




      <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="状态" prop="orderStatus">
            <el-input v-model="form.orderStatus" placeholder="状态" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <!--<el-button type="primary" @click="submitForm">确认发货</el-button>-->
          <!--<el-button @click="cancel">取 消</el-button>-->
        </div>
      </el-dialog>

      <el-dialog
        title="线下支付凭证"
        :visible.sync="dialogVoucher"
        width="50%"
        :before-close="handleClose">
        <el-image
          style="width: 100%; height: 100%"
          :src="voucherUrl"
          :preview-src-list="voucherUrlList">
        </el-image>
        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVoucher = false">取 消</el-button>
          <el-button type="primary" @click="dialogVoucher = false">确 定</el-button>
        </span>
      </el-dialog>

    </el-card>
  </div>
</template>

<script>
  import {
    listInfo, getInfo, exportInfo,
    listInfoPc, getInfoPc, listInfopi,
    getInfopi, listInfodd, getInfodd,
    selectById, listInfopiTwo, listInfoYI,
    listInfoER, listInfoSAN, listInfoSI,
    listInfoWU, listInfoLIU, listInfoQI,
    updateFaHuo, updateMaster,selectOrderVoucher
  } from "@/api/shopping/ordermaster";
  export default {
    name: "dataOrder",
    data(){
      return{
        loading: true,
        masterList:[],
        masterListYI:[],masterListER:[],masterListSAN:[],masterListSI:[],masterListWU:[],masterListLIU:[],masterListQI:[],
        defaultDictType:"",
        typeOptions: [],
        voucherUrl: null,
        voucherUrlList: [],
        total: 0,
        // 显示搜索条件
        showSearch: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        title: "",
        // 是否显示弹出层
        open: false,
        form:{ },
        // 查看凭证弹出层
        dialogVoucher:false,
        queryParams:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined,
          orderSn: null,
          customerId: null,
          shippingUser: null,
          province: null,
          city: null,
          district: null,
          address: null,
          paymentMethod: null,
          orderMoney: null,
          districtMoney: null,
          shippingMoney: null,
          paymentMoney: null,
          shippingCompName: null,
          shippingSn: null,
          shippingTime: null,
          payTime: null,
          receiveTime: null,
          orderStatus: null,
          orderPoint: null,
          invoiceTime: null,
          modifiedTime: null
        },



        defaultDictTypeYI:"",
        totalYI: 0,
        queryParamsYI:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeER:"",
        totalER: 0,
        queryParamsER:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeSAN:"",
        totalSAN: 0,
        queryParamsSAN:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeSI:"",
        totalSI: 0,
        queryParamsSI:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeWU:"",
        totalWU: 0,
        queryParamsWU:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeLIU:"",
        totalLIU: 0,
        queryParamsLIU:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        },
        defaultDictTypeQI:"",
        totalQI: 0,
        queryParamsQI:{
          pageNum: 1,
          pageSize: 10,
          productId: undefined
        }
      }
    },
    created(){
      const productId = this.$route.params && this.$route.params.productId;

      this.getInfopi(productId);
      this.getInfopiYI(productId);
      this.getInfopiER(productId);
      this.getInfopiSAN(productId);
      this.getInfopiSI(productId);
      this.getInfopiWU(productId);
      this.getInfopiLIU(productId);
      this.getInfopiQI(productId);
      this.getTypeList();
    },
    methods:{

      handleUpdate(row) {
        const orderId = row.orderId || this.ids
        console.log(orderId)
        this.$confirm(
          '是否确认发货"' + orderId + '"的订单?',
          "警告",
          {
            confirmButtonText: "确定发货",
            cancelButtonText: "取消",
            type: "warning",
          }
        )
          .then(function () {
            return updateFaHuo(orderId);
          })
          .then(() => {
          this.getListER();
        this.getListSAN();
        this.msgSuccess("发货成功");
      })
      .catch(function () {});
      },


      getInfopi(productId){
        getInfopi(productId).then(res=>{
          this.queryParams.productId = res.data.productId;
        this.defaultDictType = res.data.productId;
        this.getList();
      })
      },


      getTypeList(){
        listInfopiTwo().then(res=>{
          this.typeOptions = res.rows;
      })
      },

// ***************************  yi
      getInfopiYI(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsYI.productId = res.data.productId;
        this.defaultDictTypeYI = res.data.productId;
        this.getListYI();
      })
      },

      getListYI() {
        listInfoYI(this.queryParamsYI).then(res=>{
          this.masterListYI = res.rows;
        this.totalYI = res.total;
        this.loading = false;
      })
      },
      handleSelectionChangeYi(selection) {
        this.ids = selection.map(item => item.orderId)
        this.single= selection.length !== 1
        this.multiple = !selection.length
      },



// ***************************  er

      getInfopiER(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsER.productId = res.data.productId;
        this.defaultDictTypeER = res.data.productId;
        this.getListER();
      })
      },

      getListER() {
        listInfoER(this.queryParamsER).then(res=>{
          this.masterListER = res.rows;
        this.totalER = res.total;
        this.loading = false;
      })
      },


      // ************************ san

      getInfopiSAN(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsSAN.productId = res.data.productId;
        this.defaultDictTypeSAN = res.data.productId;
        this.getListSAN();
      })
      },

      getListSAN() {
        listInfoSAN(this.queryParamsSAN).then(res=>{
          this.masterListSAN = res.rows;
        this.totalSAN = res.total;
        this.loading = false;
      })
      },

      // ************************ si

      getInfopiSI(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsSI.productId = res.data.productId;
        this.defaultDictTypeSI = res.data.productId;
        this.getListSI();
      })
      },

      getListSI() {
        listInfoSI(this.queryParamsSI).then(res=>{
          this.masterListSI = res.rows;
        this.totalSI = res.total;
        this.loading = false;
      })
      },

      // ************************ wu
      getInfopiWU(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsWU.productId = res.data.productId;
        this.defaultDictTypeWU = res.data.productId;
        this.getListWU();
      })
      },

      getListWU() {
        listInfoWU(this.queryParamsWU).then(res=>{
          this.masterListWU = res.rows;
        this.totalWU = res.total;
        this.loading = false;
      })
      },

      // ************************ liu

      getInfopiLIU(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsLIU.productId = res.data.productId;
        this.defaultDictTypeLIU = res.data.productId;
        this.getListLIU();
      })
      },

      getListLIU() {
        listInfoLIU(this.queryParamsLIU).then(res=>{
          this.masterListLIU = res.rows;
        this.totalLIU = res.total;
        this.loading = false;
      })
      },

      // ************************ qi
      getInfopiQI(productId){
        getInfopi(productId).then(res=>{
          this.queryParamsQI.productId = res.data.productId;
        this.defaultDictTypeQI = res.data.productId;
        this.getListQI();
      })
      },

      getListQI() {
        listInfoQI(this.queryParamsQI).then(res=>{
          this.masterListQI = res.rows;
        this.totalQI = res.total;
        this.loading = false;
      })
      },



      getList(){
        this.loading = true;
        listInfodd(this.queryParams).then(res=>{
          this.masterList = res.rows;
        this.total = res.total;
        this.loading = false;
      })
      },

      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },

      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },

      reset() {
        this.form = {
          orderId: null,
          orderSn: null,
          customerId: null,
          shippingUser: null,
          province: null,
          city: null,
          district: null,
          address: null,
          paymentMethod: null,
          orderMoney: null,
          districtMoney: null,
          shippingMoney: null,
          paymentMoney: null,
          shippingCompName: null,
          shippingSn: null,
          createTime: null,
          shippingTime: null,
          payTime: null,
          receiveTime: null,
          orderStatus: 0,
          orderPoint: null,
          invoiceTime: null,
          modifiedTime: null
        };
        this.resetForm("form");
      },

      handleSelectionChange(selection){
        this.ids = selection.map(item => item.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },



      handleSelectionChangeER(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      handleSelectionChangeSAN(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      handleSelectionChangeSI(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      handleSelectionChangeWU(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      handleSelectionChangeLIU(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      handleSelectionChangeQI(select){
        this.ids = selection.map(item => itme.orderId)
        this.single = selection.length !=1
        this.multiple = !selection.length
      },
      // 查看线下支付凭证
      handelDialogVoucher(soult){
        this.dialogVoucher = true;
        selectOrderVoucher(soult.orderId).then((res) =>{
          this.voucherUrlList = [];
          this.voucherUrl = res.data.orderVoucherUrl;
          this.voucherUrlList.push(res.data.orderVoucherUrl);
        })
      }


    }



  }
</script>

<style scoped>

</style>
